#define _CRT_SECURE_NO_WARNINGS 1






#include<iostream>
#include<string>

using namespace std;

int countSubstring(const char* mainStr, const char* subStr)
{
    int count = 0;
    const char* ptr = mainStr;
    while ((ptr = strstr(ptr, subStr)) != NULL)
    {
        count++;
        ptr += strlen(subStr);
    }
    return count;
}

int main()
{
    char mainStr[1000];
    char subStr[] = "WACE";
    cin >> mainStr;
    int result = countSubstring(mainStr, subStr);
    cout << result;

    return 0;
}